import { h } from 'vue'
import { nullC  } from '@/util/common'

// 格式化页面的审核状态
export const formatStatus = (text: string, record: object = {}) => {
  const status: {
    [key: string] : object
  } = {
    '1': { textColor: '', bgColor: '' },
    '2': { textColor: '#FA8C16', bgColor: '#FA8C16' },
    '3': { textColor: '#52C41A', bgColor: '#52C41A' },
    '4': { textColor: '#F5222D', bgColor: '#F5222D' },
  }

  const res = status[record['status']] || {}

  return h('div', { style: { background: nullC(res['bgColor']) } }, [
    h(text, { style: { color: nullC(res['textColor']) }}),
  ])
}